import React, { Component } from 'react';
import { Link } from 'react-router-dom'
import { Tabs } from 'antd';
const TabPane = Tabs.TabPane;

export default class FilmPage extends Component {
  constructor() {
    super();
    this.changeTab = this.changeTab.bind(this); 
  }
  static propTypes = {

  };

  changeTab(tabId) {
    if(tabId == 1) {
      // 传参: 另一边通过this.props.location获取,通过url后面加参数则用this.props.match获取
      this.props.history.push({pathname: '/film/now-playing',params:{test: 2},query:{b:3}});
    } else {
      this.props.history.push('/film/coming-soon?id=100');
    }
  
  }
  render() {
    return (
      <div className="film-film-page">
        <Tabs defaultActiveKey="1" onChange={this.changeTab} className="w100pc">
          <TabPane tab="Tab 1" key="1"></TabPane>
          <TabPane tab="Tab 2" key="2"></TabPane>
        </Tabs>
        <div>
          {this.props.children}
        </div>
      </div>
    );
  }
}
